package com.king.juc.syncmode;

import java.util.Set;

/**
 * 保护性暂停V2
 * @author king
 * @date 2020/11/5 19:09
 */
public class SendMail {
    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 3; i++) {
            new People().start();
        }

        Thread.sleep(1000);
        for (int id : MailBoxes.getIds()){
            // 一一对应
            new Postman(id, "内容: " + id).start();
        }
    }
}
